<template>
  <div>
     <el-button @click="add()" type="danger">添加</el-button>
    <v-add :obj="obj" ref="oCh"></v-add>
    <v-list @aa="aa"></v-list>
  </div>
</template>

<script>
// import {menuList} from "../../../request/api.js"
import vAdd from "./components/add.vue"
import vList from "./components/list.vue"
export default {
  data() {
    return {
     obj:{
       isTrue:false,
       isAdd:false
     },
     list:[]
    };
  },
  components:{
vAdd,
vList
  },
  methods:{
    add(){
      //添加
      this.obj.isTrue=true
      this.obj.isAdd=true
    },
    aa(id){
      //编辑
      this.obj.isTrue=true
       this.obj.isAdd=false
       this.$refs.oCh.huo(id)
    }
  }
}
</script>

<style>

</style>